﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Form_YOLO_NET8
{
    public partial class LoginForm : Form
    {
        public LoginForm()
        {
            InitializeComponent();
        }

        private void btn_Login_Click(object sender, EventArgs e)
        {
            if (tb_Password.Text != null)
            {
                if (tb_Password.Text == "123456")
                {
                    this.DialogResult = DialogResult.OK;
                    this.Dispose();
                    this.Close();
                }
                else 
                { 
                    MessageBox.Show($"[密码输入错误]\n请重新输入密码", "警告", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    tb_Password.Text = "";
                }

            }

        }

        private void btn_Exit_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Dispose();
            this.Close();
        }

        private void LoginForm_Load(object sender, EventArgs e)
        {
            List<string> list = new List<string>()
            {
            "作业员", "管理员", "工程师"
            };
            this.Cob_Username.DataSource = list;
        }
    }
}
